<?php $this->start('admin_menu') ?>
<?php echo $this->element('admin_menu', array('str_item' => 'settings')) ?>
<?php $this->end(); ?>

<div class="sliders form">
    <?php echo $this->Form->create('Slider', array('type' => 'file')); ?>
    <h2><?php echo __('Sliders Management - Add Slider'); ?></h2>
    <?php
    echo $this->Session->flash();
    echo $this->Session->flash('good');
    echo $this->Session->flash('bad');
    ?>

    <table class="form-table">
        <tr>
            <td class='l-style'><?php echo __('Name') ?><span class='star-rq'> * </span></td>
            <td class="r-style width_middle"><?php echo $this->Form->input('name', array('label' => false, 'class' => 'required')); ?></td>
        </tr>
        <tr>
            <td class='l-style'><?php echo __('Order') ?></td>
            <td class="r-style width_middle"><?php echo $this->Form->input('order', array('label' => false, 'default' => 0, 'maxlength' => 5, 'class' => 'number-mipt required digits')); ?></td>
        </tr>	
        <tr>
            <td class='l-style'><?php echo __('Size') ?></td>
            <td class="r-style width_middle">
                <?php echo $this->Form->input('width', array('label' => __("Width&nbsp;&nbsp;"), 'maxlength' => 5, 'default' => 100, 'class' => 'number-mipt required digits', 'div' => false)); ?>
                <?php echo $this->Form->input('height', array('label' => __("Height&nbsp;&nbsp;"), 'maxlength' => 5, 'default' => 100, 'class' => 'number-mipt required digits', 'div' => false)); ?>
            </td>
        </tr>		
        <tr>
            <td class='l-style'><?php echo __('Status') ?></td>
            <td class="r-style width_middle">
                <?php echo $this->Form->radio("status", array(Slider::hide => __('Hide'), Slider::show => __('Show')), array('legend' => false, 'default' => Slider::hide)); ?>
            </td>
        </tr>
        <tr>
            <td class='l-style'><?php echo __('Slide') ?></td>
            <td class="r-style width_middle"><?php echo $this->Form->input('slide', array('label' => false)); ?></td>
        </tr>	
        <tr>
            <td class='l-style'><?php echo __('Images') ?></td>
            <td class="r-style width_middle">
                <table class="opt-val-tb" id="images-slider">
                    <tr>
                        <th><?php echo __('Order') ?></th>
                        <th><?php echo __('Image') ?></th>
                        <th><?php echo __('File') ?></th>
                        <th><?php echo __('Url') ?></th>
                        <th><?php echo __('Delete') ?></th>
                    </tr>
                    <tr>
                        <td class="col-no"><?php echo $this->Form->input('Image.0.order', array('label' => false, 'class' => 'number-mipt required digits', 'default' => 0)); ?></td>
                        <td class="post-img-small"></td>
                        <td class="slider-images">
                            <?php
                            echo $this->Form->input('Image.0.photo', array('label' => false, 'type' => 'file', 'class' => 'required'));
                            echo $this->Form->input('Image.0.dir', array('type' => 'hidden'));
                            echo $this->Form->input('Image.0.mimetype', array('type' => 'hidden'));
                            echo $this->Form->input('Image.0.filesize', array('type' => 'hidden'));
                            echo $this->Form->input('Image.0.owner_model', array('type' => 'hidden', 'default' => 'Slider'))
                            ?>
                        </td>
                        <td style="width: 30%;"><?php echo $this->Form->input('Image.0.url', array('label' => false, 'style' => 'width: 90%')); ?></td>
                        <td style="width: 25%;text-align:center"></td>
                    </tr>
                </table>
                <span id="add-more-slide" class="add-more-link"><?php echo __('Add more image') ?></span>
            </td>
        </tr>				
        <tr>
            <td class='l-style no-border no-background'>
                (<span class='red-star'>*</span>) <?php echo __('Required') ?>
            </td>
            <td class='r-style actions no-border no-background'><?php echo $this->Form->end(__('Submit')); ?></td>
        </tr>
    </table>
</div>

<script type="text/javascript">
    var countImages = 1;
</script>

<div class='actionct'>
    <span class='btn-act'><span><?php echo $this->Html->link(__('Cancel'), array('action' => 'index'), array('class' => 'back-act')); ?></span></span>
</div>
